<template>
  <div style="background-color: white;margin-top: -19px;">
    <div style="margin-top: 20px">
      <el-form :model="formData" ref="vForm" :rules="rules" label-position="left" label-width="100px"
               size="default" @submit.prevent>
        <div class="tab-container">
          <el-tabs v-model="tab2ActiveTab" type="border-card">
            <el-tab-pane name="tab1" label="归还记录">
              <el-row>
                <el-col :span="5" class="grid-cell">
                  <el-form-item label="姓名：" prop="input101875" class="label-right-align">
                    <el-input v-model="search.emp_name" type="text" clearable></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="5" class="grid-cell">
                  <el-form-item label="物品名称：" prop="input88478" class="label-right-align">
                    <el-input v-model="search.name" type="text" clearable></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="1" class="grid-cell" style="margin-left: 10px">
                  <div class="static-content-item">
                    <el-button @click="shuax" type="danger" plain>清空</el-button>
                  </div>
                </el-col>
                <el-col :span="1" class="grid-cell" style="margin-left: 20px">
                  <div class="static-content-item">
                    <el-button @click="cha" type="primary" plain>查询</el-button>
                  </div>
                </el-col>
              </el-row>
              <!--物品归还记录信息 -->
              <div>
                <el-table :data="tableData" style="width: 100%" height="520" :header-cell-style="{textAlign: 'center'}" :cell-style="{ textAlign: 'center' }" >
                  <el-table-column prop="id" label="编号" width="55"/>
<!--              <el-table-column prop="gsPyId" label="申请编号"/>-->
                  <el-table-column prop="emp.empName" label="姓名"/>
                  <el-table-column prop="code" label="物品编号"/>
                  <el-table-column prop="goods.name" label="物品名称"/>
                  <el-table-column prop="goods.spec" label="物品规格"/>
                  <el-table-column prop="num" label="归还数量"/>
                  <el-table-column prop="createTime" label="归还时间"/>
                  <el-table-column prop="empName" label="申请人"/>
                </el-table>
              </div>




            </el-tab-pane>
          </el-tabs>
        </div>
      </el-form>
    </div>
  </div>

</template>

<script>
import {selectGsRestoreRecord} from "../../../network/adm/MyProperty";

export default {
  components: {},
  props: {},
  data() {
    return {
      formData: {
        input101875: "",
        input69115: "",
      },
      search:{
        emp_name: null,
        name:null
      },
      tableData: [],
      rules: {},
      'tab2ActiveTab': 'tab1',
    }
  },
  methods: {
    cha(){
      this.selectGsRestoreRecord();
    },
    //刷洗
    shuax(){
      this.selectGsRestoreRecord2();
      this.search.name=null;
      this.search.emp_name=null;
    },
    //获取归还记录信息
    selectGsRestoreRecord(){
      let params={
        emp_name:this.search.emp_name,
        name:this.search.name
      }
      selectGsRestoreRecord(params).then(data=>{
        this.tableData=data.data
        console.log(data)
        console.log(this.tableData)
      })
    },
    //获取归还记录信息
    selectGsRestoreRecord2(){
      let params={
        emp_name:null,
        name:null,
      }
      selectGsRestoreRecord(params).then(data=>{
        this.tableData=data.data
        console.log(data)
        console.log(this.tableData)
      })
    },


  },
  created() {
  this.selectGsRestoreRecord();
  }
}

</script>

<style lang="scss">




.el-input-number.full-width-input,
.el-cascader.full-width-input {
  width: 100% !important;
}

.el-form-item--medium {
  .el-radio {
    line-height: 36px !important;
  }

  .el-rate {
    margin-top: 8px;
  }
}

.el-form-item--small {
  .el-radio {
    line-height: 32px !important;
  }

  .el-rate {
    margin-top: 6px;
  }
}

.el-form-item--mini {
  .el-radio {
    line-height: 28px !important;
  }

  .el-rate {
    margin-top: 4px;
  }
}

.clear-fix:before,
.clear-fix:after {
  display: table;
  content: "";
}

.clear-fix:after {
  clear: both;
}

.float-right {
  float: right;
}

</style>

<style lang="scss" scoped>
div.table-container {
  table.table-layout {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;

    td.table-cell {
      display: table-cell;
      height: 36px;
      border: 1px solid #e1e2e3;
    }
  }
}

div.tab-container {}

.label-left-align ::v-deep .el-form-item__label {
  text-align: left;
}

.label-center-align ::v-deep .el-form-item__label {
  text-align: center;
}

.label-right-align ::v-deep .el-form-item__label {
  text-align: right;
}

.custom-label {}

.static-content-item {
  min-height: 20px;
  display: flex;
  align-items: center;

  ::v-deep .el-divider--horizontal {
    margin: 0;
  }
}

</style>